﻿<%@ Page Title="" Language="C#" MasterPageFile="~/site.Master" AutoEventWireup="true" CodeFile="admin.aspx.cs" Inherits="admin" ValidateRequest="false" %>
<%@ MasterType VirtualPath="~/site.Master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
	<div style="width: 850px; text-align:center; margin: 0 auto;">

	<!-- Big Picture Panels -->
	<asp:Panel ID="pnlBlogs" runat="server">
		Please choose a blog to administer: <br /><br />
		<asp:Repeater ID="rBlogs" runat="server" OnItemDataBound="rBlogs_ItemDataBound">
			<ItemTemplate>
				<asp:HyperLink ID="hlBlog" runat="server" BackColor="#ffffff" />
				&nbsp; (<asp:Label ID="lblRelationshipType" runat="server" />)
			</ItemTemplate>
			<AlternatingItemTemplate>
				<asp:HyperLink ID="hlBlog" runat="server" BackColor="#aaaaaa" />
				&nbsp; (<asp:Label ID="lblRelationshipType" runat="server" />) <br />
			</AlternatingItemTemplate>
		</asp:Repeater> <br /><br />
		<asp:Button ID="btnAddBlog" runat="server" Text="Add a Blog &gt;" CssClass="button" OnClick="btnAddBlog_Click" />
	</asp:Panel>
	<asp:Panel ID="pnlNewBlog" runat="server" Visible="false">
		<b>Create a new Blog</b><br /><br />
		Enter Name of blog to create: <asp:TextBox ID="txtCreateBlogName" runat="server" /> <br />
		<asp:Button ID="btnNewBlogOK" Text="OK &gt;" runat="server" OnClick="btnNewBlogOK_Click" CssClass="button" />
		<asp:Button ID="btnNewBlogCxl" runat="server" Text="Cancel" OnClick="btnNewBlogCxl_Click" CssClass="button" />
	</asp:Panel>
	<asp:Panel ID="pnlBlogAdmin" runat="server" Visible="false">
		<b>Managing blog: <asp:HyperLink ID="hlManageBlog" runat="server" /></b> 
			<asp:HyperLink ID="hlRSS" runat="server">
				<img src="Images/rss.png" alt="RSS feed" style="padding: 10px; position:relative; top: 15px; width: 20px;" />
			</asp:HyperLink>
		<br /><br />
		<asp:Button ID="btnAddPost" runat="server" Text="Add Post" OnClick="btnAddPost_Click" CssClass="button" Width="150" />
		<asp:Button ID="btnManagePosts" runat="server" Text="Manage Posts" OnClick="btnManagePosts_Click" CssClass="button" Width="150" />
		<asp:Button ID="btnManageLinks" runat="server" Text="Manage Links" OnClick="btnManageLinks_Click" CssClass="button" Width="150" />
		<asp:Button ID="btnManageCategories" runat="server" Text="Manage Categories" OnClick="btnManageCategories_Click" CssClass="button" Width="150" />
	</asp:Panel>
	<br /><br />

	<!-- Management Panels -->
	<asp:Panel ID="pnlManagePosts" runat="server" Visible="false" CssClass="PanelBox">
		<b>Post Manager</b> <br /><br />
		<table style="width: 100%;">
			<asp:Repeater ID="rPosts" runat="server" OnItemDataBound="rPosts_ItemDataBound">
				<ItemTemplate>
					<tr><td style="border-bottom: dashed 1px #777777; text-align:justify;">
						<b><asp:Label ID="lblTitle" runat="server" /></b> (Modified <asp:Label ID="lblDate" runat="server" />)<br />
						   <asp:Label ID="lblExcerpt" runat="server" /> 
					</td><td style="border-bottom: dashed 1px #777777; width: 104px; text-align:left;">
						<asp:Button ID="btnEnable" runat="server" Text="Enable" CssClass="button" OnClick="btnEnable_Click" Width="100"  />	<br />
						<asp:Button ID="btnEdit" runat="server" Text="Edit" CssClass="button" OnClick="btnEdit_Click" Width="100"  />		<br />
						<asp:Button ID="btnDelete" runat="server" Text="Delete" CssClass="button" OnClick="btnDelete_Click" Width="100"  />	<br />
					</td></tr>
				</ItemTemplate>
			</asp:Repeater>
		</table>

	</asp:Panel>
	<asp:Panel ID="pnlEditPost" runat="server" Visible="false" CssClass="PanelBox">
		<b>Post Editor</b> <br /><br />

		<i>Important note: </i> Some HTML is allowed. Escape HTML sequences with <b>[[</b> and <b>]]</b> instead of <b>&lt;</b> and <b>&gt;</b>. <br /><br />

		<table style="width: 100%; text-align:left;">
			<tr>
				<td colspan="2">
					Title: <asp:TextBox ID="txtPostTitle" runat="server" Width="600" /> <br />
					<table style="width: 100%;"><tr>
						<td>Post #<asp:Label ID="lblPostID" runat="server" /></td>
						<td style="text-align:right;">
					Publish on:
						<asp:DropDownList ID="ddlPostMonth" runat="server" /> /
						<asp:TextBox ID="txtPostDay" runat="server" Width="50" MaxLength="2" /> /
						<asp:TextBox ID="txtPostYear" runat="server" Width="50" MaxLength="4" /> @
						<asp:TextBox ID="txtPostHour" runat="server" Width="50" MaxLength="2" /> :
						<asp:TextBox ID="txtPostMinute" runat="server" Width="50" MaxLength="2" /> 
					</td></tr><tr><td style="text-align:right;" colspan="2"><i>Note: Post must be set to "Visible" for delayed publishing to take effect.</i>
					</td></tr></table>
					
				</td>
				<td rowspan="4" style="width: 175px;">
					<!-- Adsense block -->
					<script type="text/javascript"><!--
						google_ad_client = "pub-6557158343810013";
						/* Blogslinger vertical 160x600 */
						google_ad_slot = "5228036850";
						google_ad_width = 160;
						google_ad_height = 600;
						//-->
						</script>
						<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
				</td>
			</tr>
			<tr>
				<td>Body: <br /><asp:TextBox ID="txtPostBody" runat="server" TextMode="MultiLine" style="width: 460px; height: 250px;" /><br /><br />
					Excerpt: <br /><asp:TextBox ID="txtPostExcerpt" runat="server" TextMode="MultiLine" style="width: 460px; height: 100px;" />
				</td>
				<td style="width: 150px; padding: 10px;">Categories:<br /><asp:ListBox ID="lbPostCategories" SelectionMode="Multiple" runat="server" style="height: 400px; width: 100%;" DataTextField="Name" DataValueField="ID" /></td>
			</tr>
			<tr>
				<td>
					[ &nbsp;&nbsp;<asp:CheckBox ID="cbPostEnabled" runat="server" Text="Visible Now" />&nbsp;&nbsp;
					| &nbsp;&nbsp;<asp:CheckBox ID="cbPostComments" runat="server" Text="Enable Comments" Checked="true" />&nbsp;&nbsp;
					| &nbsp;&nbsp;<asp:CheckBox ID="cbPostWall" runat="server" Text="Post to FB Wall" Checked="true" />&nbsp;&nbsp;
					| &nbsp;&nbsp;<asp:HyperLink ID="hlPreview" runat="server" Text="Preview" Enabled="false" />&nbsp;&nbsp;
					] <br />
				</td>
				<td>Type:
					<asp:DropDownList ID="ddlPostType" runat="server">
						<asp:ListItem Text="Blog Post" Value="1" Selected="True" />
						<asp:ListItem Text="Article" Value="2" />
					</asp:DropDownList>
				</td>
			</tr>
			<tr><td>
				<asp:Button ID="btnPostOK" runat="server" Text="Save &gt;" OnClick="btnPostOK_Click" />
				<asp:Button ID="btnPostCxl" runat="server" Text="Cancel" OnClick="btnPostCxl_Click" />
			</td></tr>
		</table>
	</asp:Panel>
	<asp:Panel ID="pnlManageLinks" runat="server" Visible="false">
		<b>Link Manager</b> <br /><br />


	</asp:Panel>
	<asp:Panel ID="pnlManageCategories" runat="server" Visible="false">
		<b>Category Manager</b> <br /><br />
		<table>
			<tr><th>Manage Categories</th><th>Add New Category</th></tr>
		<tr><td>
			<table>
				<asp:Repeater ID="rCatManager" runat="server" OnItemDataBound="rCatManager_ItemDataBound">
					<ItemTemplate>
						<tr>
							<td><asp:HyperLink ID="hlCategory" runat="server" /></td>
							<td><asp:Button ID="btnEditCat" runat="server" Text="Edit" OnClick="btnEditCat_Click" />
								<asp:Button ID="btnDelCat" runat="server" Text="Delete" OnClick="btnDelCat_Click" /></td>
						</tr>
					</ItemTemplate>
				</asp:Repeater>
			</table>
		</td><td>
			Category Name: <asp:TextBox ID="txtAddCat" runat="server" /><asp:Button ID="btnAddCat" runat="server" Text="Add Category &gt;" OnClick="btnAddCat_Click" />
		</td></tr></table>


	</asp:Panel>

</div>
</asp:Content>